package org.gwu.seuss.service;

import java.io.IOException;
import java.security.GeneralSecurityException;

import org.gwu.seuss.communication.exception.AuthenticationException;
import org.gwu.seuss.communication.exception.AuthorizationException;
import org.gwu.seuss.communication.request.Actions;
import org.gwu.seuss.domain.User;

public interface UserService {

	public void login(String username, String password) throws AuthenticationException;
	
	public void actionAllowed(String username, Actions action) throws AuthorizationException;
	
	public User selectUserByEmail(String email);
	
	public int updateUsersSessionKey(byte[] sessionKey, String email);
	
	public int updateUserEmail(String oldEmail, String newEmail);
	
	public int createUser(String username, String password) throws GeneralSecurityException, IOException;
	
	public int disableUser(String username);
	
	public int enableUser(String username);
	
	public int removeUser(String username);

	int resetPassword(String username, String newPassword, String oldPassword)
			throws AuthenticationException, GeneralSecurityException, IOException;
}